import QtQuick 
import QtQuick.Controls 
import QtQuick.Layouts
//import QtQuick.Templates 2.1 as T
Button{
    id:control
    horizontalPadding: 25
    verticalPadding: 10
    // 默认内边距，可根据需要调整
    implicitWidth: contentItem.implicitWidth + horizontalPadding
    implicitHeight:  contentItem.implicitHeight + verticalPadding
    property double radius: 0
    property var foregroundColor: WQTheme.foreground
    property var backgroundColor: WQTheme.controlBackground
    // property borderSize: 1
    contentItem: Text {
        text:  control.text
        font: control.font
        opacity: enabled ? 1.0 : 0.3
        color:  highlighted?WQTheme.primary:control.foregroundColor
        horizontalAlignment: Text.AlignHCenter
        verticalAlignment: Text.AlignVCenter
    }
    background: Rectangle {
        id:rect
        width: control.width
        height: control.height
        opacity: enabled ? (control.down? 0.8:1) :0.3
        // border.color: control.down ? "#17a81a" : "#21be2b"
        // border.width: control.borderSize
        radius: control.radius
        color: control.backgroundColor
    }
    Component.onCompleted: {
        //console.log("Button Component.onCompleted,radius,x,y=",radius,x,y)
    }
}  
 
 
 


    
 